package org.person.gift.strategy.impl;

import cn.ronghuanet.gift.domain.GoodsSku;
import cn.ronghuanet.gift.strategy.SplitOrderStrategy;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class SplitOrderByTenantStrategy implements SplitOrderStrategy {

    @Override
    public Map<Long, List<GoodsSku>> splitOrder(List<GoodsSku> skus) {
        return skus.stream().collect(Collectors.groupingBy(x -> x.getTenantId()));
    }
}
